<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.2.0">


  <link rel="apple-touch-icon" sizes="180x180" href="/text/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/text/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/text/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/text/images/logo.svg" color="#222">

<link rel="stylesheet" href="/text/css/main.css">



<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.15.1/css/all.min.css">
  <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/animate.css@3.1.1/animate.min.css">

<script class="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"bcho.gitee.io","root":"/text/","scheme":"Muse","version":"8.0.2","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12},"copycode":false,"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"prism":false,"i18n":{"placeholder":"Searching...","empty":"We didn't find any results for the search: ${query}","hits_time":"${hits} results found in ${time} ms","hits":"${hits} results found"}};
  </script>

  <meta name="description" content="下载准备node.js:  官网git: git-downloads  官网下载可能较慢，可以前往 淘宝 Git for Windows 镜像. 下载对应安装包。">
<meta property="og:type" content="article">
<meta property="og:title" content="我的博客">
<meta property="og:url" content="https://bcho.gitee.io/text/2020/11/02/%E6%88%91%E7%9A%84%E5%8D%9A%E5%AE%A2/index.html">
<meta property="og:site_name" content="Hexo">
<meta property="og:description" content="下载准备node.js:  官网git: git-downloads  官网下载可能较慢，可以前往 淘宝 Git for Windows 镜像. 下载对应安装包。">
<meta property="og:locale" content="en_US">
<meta property="article:published_time" content="2020-11-02T02:31:07.000Z">
<meta property="article:modified_time" content="2020-11-02T03:11:41.230Z">
<meta property="article:author" content="John Doe">
<meta name="twitter:card" content="summary">


<link rel="canonical" href="https://bcho.gitee.io/text/2020/11/02/%E6%88%91%E7%9A%84%E5%8D%9A%E5%AE%A2/">


<script class="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'en'
  };
</script>

  <title>我的博客 | Hexo</title>
  






  <noscript>
  <style>
  body { margin-top: 2rem; }

  .use-motion .menu-item,
  .use-motion .sidebar,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header {
    visibility: visible;
  }

  .use-motion .header,
  .use-motion .site-brand-container .toggle,
  .use-motion .footer { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle,
  .use-motion .custom-logo-image {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line {
    transform: scaleX(1);
  }

  .search-pop-overlay, .sidebar-nav { display: none; }
  .sidebar-panel { display: block; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
  <div class="headband"></div>

  <main class="main">
    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="Toggle navigation bar">
    </div>
  </div>

  <div class="site-meta">

    <a href="/text/" class="brand" rel="start">
      <i class="logo-line"></i>
      <h1 class="site-title">Hexo</h1>
      <i class="logo-line"></i>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>







</div>
        
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
  </div>

  <aside class="sidebar">

    <div class="sidebar-inner sidebar-nav-active sidebar-toc-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          Table of Contents
        </li>
        <li class="sidebar-nav-overview">
          Overview
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <section class="post-toc-wrap sidebar-panel">
            <div class="post-toc animated"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#%E4%B8%8B%E8%BD%BD%E5%87%86%E5%A4%87"><span class="nav-number">1.</span> <span class="nav-text">下载准备</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#hexo%E6%90%AD%E5%BB%BA"><span class="nav-number">2.</span> <span class="nav-text">hexo搭建</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#gitee%E6%90%AD%E5%BB%BA"><span class="nav-number">3.</span> <span class="nav-text">gitee搭建</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E8%BF%9E%E6%8E%A5hexo%E5%92%8Cgitee"><span class="nav-number">4.</span> <span class="nav-text">连接hexo和gitee</span></a></li></ol></div>
        </section>
        <!--/noindex-->

        <section class="site-overview-wrap sidebar-panel">
          <div class="site-author site-overview-item animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">John Doe</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap site-overview-item animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/text/archives">
          <span class="site-state-item-count">1</span>
          <span class="site-state-item-name">posts</span>
        </a>
      </div>
  </nav>
</div>



        </section>
      </div>
    </div>
  </aside>
  <div class="sidebar-dimmer"></div>


    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


    <div class="main-inner post posts-expand">
      

      

  


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="en">
    <link itemprop="mainEntityOfPage" href="https://bcho.gitee.io/text/2020/11/02/%E6%88%91%E7%9A%84%E5%8D%9A%E5%AE%A2/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/text/images/avatar.gif">
      <meta itemprop="name" content="John Doe">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Hexo">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          我的博客
        </h1>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">Posted on</span>
      

      <time title="Created: 2020-11-02 10:31:07 / Modified: 11:11:41" itemprop="dateCreated datePublished" datetime="2020-11-02T10:31:07+08:00">2020-11-02</time>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
        <h1 id="下载准备"><a href="#下载准备" class="headerlink" title="下载准备"></a><strong>下载准备</strong></h1><p><strong>node.js:</strong>  <a target="_blank" rel="noopener" href="https://nodejs.org/en/">官网</a><br><strong>git:</strong> <a target="_blank" rel="noopener" href="https://git-scm.com/downloads">git-downloads</a></p>
<blockquote>
<p>官网下载可能较慢，可以前往 <a target="_blank" rel="noopener" href="https://npm.taobao.org/mirrors/git-for-windows/">淘宝 Git for Windows 镜像</a>. 下载对应安装包。</p>
<a id="more"></a>
</blockquote>
<h1 id="hexo搭建"><a href="#hexo搭建" class="headerlink" title="hexo搭建"></a><strong>hexo搭建</strong></h1><ol>
<li><p>安装准备好的软件<br>判断是否成功安装  ，打开cmd并输入</p>
<blockquote>
<p>node -v </p>
</blockquote>
<blockquote>
<p>mpn -v </p>
</blockquote>
</li>
<li><p>在本地计算机中新建一个文件夹用于保存博客数据</p>
<blockquote>
<p><strong><u>在创建的文件夹路径下输入下列数条cmd命令</u></strong></p>
</blockquote>
</li>
<li><p>安装Hexo</p>
</li>
</ol>
<blockquote>
<p>npm install -g hexo-cli</p>
</blockquote>
<ol>
<li>初始化hexo , 并在命令行路径下创建一个名为blog的文件</li>
</ol>
<blockquote>
<p>hexo init blog</p>
</blockquote>
<blockquote>
<p><strong><u>在上述blog文件路径下输入下列数条cmd命令</strong></u>**</p>
</blockquote>
<ol>
<li>创建一个名为”我的博客”的文章</li>
</ol>
<blockquote>
<p>hexo n “我的博客”</p>
</blockquote>
<ol>
<li>令网站生成对应的内容</li>
</ol>
<blockquote>
<p>hexo g</p>
</blockquote>
<ol>
<li>启动服务预览</li>
</ol>
<blockquote>
<p>hexo s</p>
</blockquote>
<ol>
<li>打开本地网站检测效果</li>
</ol>
<blockquote>
<p>浏览器地址 ：localhost:4000</p>
</blockquote>
<h1 id="gitee搭建"><a href="#gitee搭建" class="headerlink" title="gitee搭建"></a>gitee搭建</h1><ol>
<li><p>注册码云账号，右上角+号新建仓库</p>
</li>
<li><p>输入仓库名</p>
</li>
<li><p>在仓库管理页面中 点击</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">初始化README启动svn访问</span><br></pre></td></tr></table></figure>
</li>
<li><p>在仓库的服务中点击-gitee pages<br>勾上强制使用https<br>点击启动<br>得到自己的博客链接</p>
</li>
</ol>
<ol start="5">
<li>在gitee设置里绑定一个主邮箱</li>
</ol>
<h1 id="连接hexo和gitee"><a href="#连接hexo和gitee" class="headerlink" title="连接hexo和gitee"></a>连接hexo和gitee</h1><ol>
<li>安装hexo-git推送</li>
</ol>
<blockquote>
<p>npm install hexo-deployer-git –save</p>
</blockquote>
<ol start="2">
<li>修改text的配置文件_config.yml</li>
</ol>
<p>在最后面的deployment部分修改成</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"># Deployment</span><br><span class="line">## Docs: https:&#x2F;&#x2F;hexo.io&#x2F;docs&#x2F;one-command-deployment</span><br><span class="line">deploy:</span><br><span class="line">  type: git</span><br><span class="line">  repo: https:&#x2F;&#x2F;gitee.com&#x2F;bcho&#x2F;text.git         (提示：这里是仓库地址https:&#x2F;&#x2F;gitee.com&#x2F;bcho&#x2F;text 后面+ .git)   </span><br><span class="line">  branch: master</span><br></pre></td></tr></table></figure>

<p>在url部分修改成</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"># URL</span><br><span class="line">## If your site is put in a subdirectory, set url as &#39;http:&#x2F;&#x2F;example.com&#x2F;child&#39; and root as &#39;&#x2F;child&#x2F;&#39;</span><br><span class="line">url:  https:&#x2F;&#x2F;bcho.gitee.io&#x2F;text     (提示：这里是生成的博客链接)</span><br><span class="line">root: &#x2F;</span><br></pre></td></tr></table></figure>

<ol start="3">
<li>下面把本地网页推送到博客：</li>
</ol>
<p>再次打开命令行 ，依次输入</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">hexo cl</span><br><span class="line">hexo g</span><br><span class="line">hexo d</span><br></pre></td></tr></table></figure>

<p>输入gitee账号地址</p>
<ol start="4">
<li>在gitee的gitee pages中点击更新</li>
</ol>
<p>点击生成的网页，即可看到推送后的博客</p>
<ol start="5">
<li>网址可以供给任何人访问。</li>
</ol>

    </div>

    
    
    

    <footer class="post-footer">

        

    </footer>
  </article>
</div>






      

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      const activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      const commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

    </div>
  </main>

  <footer class="footer">
    <div class="footer-inner">
      

      

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">John Doe</span>
</div>
  <div class="powered-by">Powered by <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.js.org/muse/" class="theme-link" rel="noopener" target="_blank">NexT.Muse</a>
  </div>

    </div>
  </footer>

  
  <script src="//cdn.jsdelivr.net/npm/animejs@3.2.1/lib/anime.min.js"></script>
<script src="/text/js/utils.js"></script><script src="/text/js/motion.js"></script><script src="/text/js/schemes/muse.js"></script><script src="/text/js/next-boot.js"></script>

  


















  








  

  

</body>
</html>
